<template>
  <div class="loginbg">
    <!-- <h1 class="tc color1 pt65"></h1> -->
    <el-row>
      <el-col :span="12">&ensp;</el-col>
      <el-col :span="12">
        <h1 class="tc color1 mt140 f36">博客后台管理</h1>
        <div class="loginBox tc">
          <span class="color1 f18 pt20">注册</span>
          <el-form ref="loginForm" :model="loginForm">
            <el-form-item label class="mt20">
              <el-input v-model="loginForm.username"></el-input>
            </el-form-item>
            <el-form-item label>
              <el-input v-model="loginForm.password"></el-input>
            </el-form-item>
            <el-form-item size="medium" class="mt55">
              <el-button type="primary" class="wb100" @click="sub">注册</el-button>
              <!-- <el-button>取消</el-button> -->
            </el-form-item>
          </el-form>
        </div>
      </el-col>
    </el-row>
    <!-- <div class="of"> -->
    <!-- <div class="wb50 fl"></div>
      <div class="wb50 fl loginBox">
        <div class="fr"></div>
    </div>-->
    <!-- </div> -->
  </div>
</template>
<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      loginForm: {
        username: '',
        password: ''
      },
      loading: false
    }
  },
  methods: {
    sub () {
      // axios
      this.$Http('POST', '/adminApi/user/addUser', {
        username: this.loginForm.username,
        password: this.loginForm.password
      }).then(data => {
        if (data.code === 0) {
          // znk.setCookie('token', data.data)
          // this.$router.push({
          //   path: '/home'
          // })
        } else {
          this.loading = false
        }
      }).catch(data => {
        console.log('44')
        this.loading = false
      })
    }
  },
  mounted () {
  }
}
</script>
<style lang="css" scoped>
.loginbg {
  position: relative;
  height: 100%;
  min-height: 500px;
  background: url("../assets/images/login_bg1.jpg");
  background-size: cover;
  background-position: center;
}
.loginBox {
  margin-top: 6%;
  margin-left: auto;
  margin-right: auto;
  padding: 20px 20px;
  width: 320px;
  height: 260px;
  background-color: #bacafb;
  border-radius: 2px;
}
</style>
